package com.xizi.秋招笔试;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-8-19下午 07:59
 */
public class Test4 {
    static int sameNum = 0;

    public static void main(String[] args) {
        Test4 test4 = new Test4();
    }

    public int maxScore(int n, int[] A, int[] B) {
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int c = find(B, n, A[i]);

            if (c > 0) {
                ans++;
                if (c == 2222) {
                    break;
                }
            }
        }
        return ans * 100 - (n - ans) * 100;
    }

    static int find(int a[], int n, int x) {//b ,4 ,9
        int min = Math.abs(a[0] - x);
        int r = -1;

        for (int i = 0; i < n; ++i) {
            if (x < a[i]) {
                continue;
            } else if (x == a[i]) {
                sameNum++;
            } else {
                if (i == n - 1) {
                    r = 2222;
                    break;
                }
                r = i;
                break;
            }
        }
        return r;
    }
}


